﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using TYBase;

namespace TYBase
{
    public static class DirectoryHelper
    {
        public static bool CheckDirectory(string saveFileDirectory)
        {
            try
            {
                 if (saveFileDirectory.Null())
                    return false;
                if (Directory.Exists(saveFileDirectory))
                {
                    return true;
                }
                Directory.CreateDirectory(saveFileDirectory);
                if (Directory.Exists(saveFileDirectory))
                {
                    return true;
                }
                return false;
            }
            catch (Exception ex)
            {
                Log.E(ex, $"CheckDirectory {saveFileDirectory}");
                return false;
            }
        }

    }
}
